<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="cn.egame.interfaces.pu.AppParameter" %>
<%@ page import="java.util.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<script type="text/javascript" src="../../../js/jquery-1.4.2.min.js"></script>
<script type="text/javascript">
	//获取系统时间
	function getTimes(){
	    var dateTime=new Date();
	    var hh=dateTime.getHours();
	    var mm=dateTime.getMinutes();
	    var ss=dateTime.getSeconds();
	
	    var yy=dateTime.getFullYear();
	    var MM=dateTime.getMonth()+1;  //因为1月这个方法返回为0，所以加1
	    var dd=dateTime.getDate();
	    var week = dateTime.getDay();
	
	    return {"yy":yy,"MM":MM,"dd":dd,"hh":hh,"mm":mm,"ss":ss,"week":week};
	}
	function writeDateInfo(myweekday)
	{
		var weekday = "";
		if(myweekday == 0)
		weekday=" 星期日";
		else if(myweekday == 1)
		weekday=" 星期一";
		else if(myweekday == 2)
		weekday=" 星期二";
		else if(myweekday == 3)
		weekday=" 星期三";
		else if(myweekday == 4)
		weekday=" 星期四";
		else if(myweekday == 5)
		weekday=" 星期五";
		else if(myweekday == 6)
		weekday=" 星期六";
		return weekday;
	}
	function bodyResize(){
		var menu = $("#menu"),detial = $("#detail_index"),width,iframe = $("#backIframe");
		if($.browser.msie && $.browser.version == '6.0'){
			width = document.body.clientWidth-parseInt(menu.width())-69;
		}else{
			width = document.body.clientWidth-parseInt(menu.width())-65;
		}
		if(width<1100){
			detial.width(1100).parent().width(1100+menu.width()+20);	
			iframe.width(1100);
		}else{
			detial.width(width).parent().width("");
			iframe.width(width);
		}
	}
	function changeIframe(src,e,obj){
		$("#menu").find("li.selected").removeClass("selected");
		$(obj).addClass("selected");
		$("#backIframe").attr("src",src);
	}
	$(function(){
		bodyResize();
		window.onresize = bodyResize;
		//设置系统时间
		setInterval(function(){
			var dt = getTimes();
			$("#time").html(dt.yy+"-"+dt.MM+"-"+dt.dd+"&nbsp;"+dt.hh+":"+dt.mm+":"+dt.ss+" "+writeDateInfo(dt.week));	
		},1000)
		$("#menu").find("strong").live("click",function(){
			var $this = $(this);
			if($this.parent().find("ul")[0]){
				var ul = $this.parent().find("ul");
			if(ul.is(":visible")){
				$this.parent().addClass("close");
				ul.slideUp();
			}else{
				$this.parent().removeClass("close");
				ul.slideDown();
			}}
		})
	})
</script>
<link type="text/css" rel="stylesheet" href="<%=request.getContextPath() %>/css/main.css"  />
</head>
<body  class="index_body">
<div class="header pt20 clearfix">
	<span class="fl" id="time">2012-03-06   11:25:30</span>
	<span class="exit fr"><a href="javascript:void(0)" onclick="setDialog('logoutDiv')">注销</a></span>
	<span class="fr">彩蛋应用运营中心欢迎您：<em id="userName">赵新亮</em></span>
</div>
<div class="index_store_top pt20 tr" id="index_top">
</div>
<div class="content clearfix">
	<div class="menu fl" id="menu" style="height:900px">
		<span class="menu_top"></span>
		<span class="menu_bom"></span>
		<ul class="menu_inner">
			<li><strong>首页</strong>
				<ul>
					<% 		
						if(request.getAttribute("listChannel1") != null){
							List<AppParameter> list = (List<AppParameter>)request.getAttribute("listChannel1");
							for(AppParameter bean:list){								
								
								%>
									<li onclick="changeIframe('<%=request.getContextPath() + bean.getRemark() %>',event,this)"><a href = "javascript:void(0)"><%=bean.getName() %></a></li>
								<%
							}
						}
					%>
				</ul>
			</li>
			<li><strong>软件</strong>
				<ul>
					<% 		
						if(request.getAttribute("listChannel2") != null){
							List<AppParameter> list = (List<AppParameter>)request.getAttribute("listChannel2");
							for(AppParameter bean:list){								
								
								%>
									<li onclick="changeIframe('<%=request.getContextPath() + bean.getRemark() %>',event,this)"><a href = "javascript:void(0)"><%=bean.getName() %></a></li>
								<%
							}
						}
					%>
				</ul>
			</li>
			<li><strong>游戏</strong>
				<ul>
					<% 		
						if(request.getAttribute("listChannel3") != null){
							List<AppParameter> list = (List<AppParameter>)request.getAttribute("listChannel3");
							for(AppParameter bean:list){								
								
								%>
									<li onclick="changeIframe('<%=request.getContextPath() + bean.getRemark() %>',event,this)"><a href = "javascript:void(0)"><%=bean.getName() %></a></li>
								<%
							}
						}
					%>
				</ul>
			</li>
			<li><strong>快速导航</strong>
				<ul>
					<% 		
						if(request.getAttribute("listChannel4") != null){
							List<AppParameter> list = (List<AppParameter>)request.getAttribute("listChannel4");
							for(AppParameter bean:list){								
								
								%>
									<li onclick="changeIframe('<%=request.getContextPath() + bean.getRemark() %>',event,this)"><a href = "javascript:void(0)"><%=bean.getName() %></a></li>
								<%
							}
						}
					%>
				</ul>
			</li>
			<li><strong>手机必备</strong>
				<ul>
					<% 		
						if(request.getAttribute("listChannel5") != null){
							List<AppParameter> list = (List<AppParameter>)request.getAttribute("listChannel5");
							for(AppParameter bean:list){								
								
								%>
									<li onclick="changeIframe('<%=request.getContextPath() + bean.getRemark() %>',event,this)"><a href = "javascript:void(0)"><%=bean.getName() %></a></li>
								<%
							}
						}
					%>
				</ul>
			</li>
		</ul>
	</div>
	<div class="details fl" id="detail_index" style="height:1200px">
		<span class="details_rt"></span><span class="details_rb"></span>
		<iframe frameborder="0" src="<%= request.getContextPath() + "/store/home/advertise/list.do" %>" id="backIframe" style="height:1200px;" scrolling="no"></iframe>
	</div>
</div>	
</body>
</html>